<template>
  <heads title="用户注册"/>
  <view class=" pink full">
    <view class="distance-top50">
      <block-chain ref="popup" describe="用户注册信息"/>
      <view v-for="certify in certificate" class="height40 text-title top">
        <view class="width-half leftmost text-center">{{ certify.key }}</view>
        <view class="width-half rightmost">
          <uni-easy-input v-model="certify.value" placeholder="请输入内容" :inputBorder="false"/>
        </view>
        <view class="width70p text-center down10">
          <hr/>
        </view>
      </view>
    </view>
    <view>
      <button type="primary" class="width70p distance-top50" @click="register">用户注册</button>
    </view>

  </view>
</template>

<script lang="ts" setup>
import Heads from "@/components/head/heads.vue";
import UniEasyInput from "@dcloudio/uni-ui/lib/uni-easyinput/uni-easyinput.vue";
import {ref} from "vue";
import BlockChain from "../../components/card/block-chain.vue";

const certificate = [
  {key: 'ORCID', value: '1234546789'},
  {key: '姓名', value: '张伟'},
  {key: '性别', value: '男'},
  {key: '学历', value: '本科'},
  {key: '电话', value: '15180864978'},
  {key: '身份', value: '程序员'},
  {key: '角色', value: '区块链工程师'},
  {key: '邮箱', value: 'jtyoui@qq.com'},
  {key: '婚姻', value: '未婚'},
  {key: '单位', value: '中国农业科学院'},
]

const popup = ref()
const sleep = 4000


function register() {
  const value = JSON.stringify(certificate)
  sessionStorage.setItem("info", value)
  popup.value.open()
  setTimeout(() => {
    uni.switchTab({url: "/pages/list/index"})
  }, sleep)
}
</script>

